<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" 
      xmlns:ui="http://java.sun.com/jsf/facelets" 
      xmlns:h="http://java.sun.com/jsf/html" 
      xmlns:f="http://java.sun.com/jsf/core">
    <h:body>
    	<ui:composition template="./templates/framework.xhtml">
			<ui:define name="content">
				<ui:include src="./templates/header.xhtml">
					<ui:param name="text" value="#{i18n['generic.back']}" />
					<ui:param name="link" value="settings.xhtml" />
				</ui:include>
				<h:form id="changePasswordForm" styleClass="primary">
					<div>
						<h:outputLabel for="currentPassword" value="#{i18n['changePassword.current']}" />
						<h:inputSecret id="currentPassword" value="#{changePasswordBean.currentPassword}" required="true" requiredMessage="#{i18n['generic.valueRequired']}" autocomplete="off" redisplay="true" validator="#{changePasswordBean.validateCurrentPassword}" />
						<span class="error"><h:message for="currentPassword" /></span>
					</div>
					<div>
						<h:outputLabel for="password" value="#{i18n['changePassword.new']}" />
						<h:inputSecret id="password" value="#{changePasswordBean.password}" required="true" requiredMessage="#{i18n['generic.valueRequired']}" autocomplete="off" redisplay="true" styleClass="switchVisibility" />
						<span class="error"><h:message for="password" /></span>
					</div>
					<div>
						<h:selectBooleanCheckbox id="passwordChecked" value="#{changePasswordBean.passwordChecked}" validator="#{genericValidationBean.validatePasswordChecked}" />
						<h:outputLabel for="passwordChecked" styleClass="checkboxLabel"><h:outputText value="#{i18n['generic.passwordChecked']}" /></h:outputLabel>
						<span class="error"><h:message for="passwordChecked" /></span>
					</div>
					<div class="buttons">
						<h:commandButton type="submit" value="#{i18n['changePassword.changeLoginPassword']}" action="#{changePasswordBean.apply}" />
						<input type="button" value="#{i18n['generic.cancel']}" onclick="location.href='settings.xhtml'" />
					</div>
				</h:form>
			</ui:define>
		</ui:composition>
    </h:body>
</html>